import asyncio

class Ads:

    def __init__(self , name):
        self.name = name

    async def loop(self):
        while True:
            print(f"------{self.name} , loop-------")
            await asyncio.sleep(2)



async def runAll():
    adses = []
    for i in range(0, 10):
        adses.append(Ads(f"ads_{i}"))

    tasks = []
    for ads in adses:
        tasks.append(ads.loop())

    await asyncio.gather(*tasks)




async def testQueue():
    q = asyncio.Queue(5)
    q.put_nowait(1)
    q.put_nowait(2)
    q.put_nowait(3)
    q.put_nowait(4)
    q.put_nowait(5)

    if q.full():
        q.get_nowait()
    q.put_nowait(6)

    print(q._queue[0])
    print(q._queue[1])
    print(q._queue[2])
    print(q._queue[3])
    print(q._queue[4])





if __name__ == '__main__':
    asyncio.run(testQueue())




